$def with(new_alarm,data_type_title_dict)
<h3 class="page-title">超标参数设置</h3>
<div class="well">
    <h3>编辑参数信息</h3>
    <form action="/alarms/$new_alarm.id/edit" method="post" class="form-horizontal">
        <div class="control-group">
            <label class="control-label" >名称</label>
            <div class="controls">

                <select name="name" class="input-middle">
                    $for k,v in data_type_title_dict.items():
                        $if v==new_alarm.field_name:
                            <option value="$v" selected="selected">$k</option>
                        $else:
                            <option value="$v" >$k</option>
                </select>

            </div>
        </div>
        <div class="control-group">
            <label class="control-label" >最大值</label>
            <div class="controls">
                <input type="number" name="max_value" value="$new_alarm.max_value" class="input-xlarge">
            </div>
        </div>
        <div class="control-group">
        <div class="controls">
          <label class="checkbox">
            <input type="checkbox" name="state"
            $if new_alarm.state:
                checked="checked"
                    > 启用
          </label>
          <button type="submit" class="btn btn-primary">保存</button>
            <a href="/alarms" data-toggle="modal" class="btn">返回</a>
        </div>
      </div>

    </form>
</div>
